import { getUserInfoApi } from '@/services/my/login/index.ts'
import { useMemberStore } from '@/stores'

/**
 * @description 更新 获取用户信息
 */
export const getUserInfo = () => {
  return new Promise((resolve, reject) => {
    try {
      const userStore = useMemberStore()
      getUserInfoApi().then((res) => {
        userStore.setUserInfo(res?.data)
        resolve(res)
      })
    } catch (error) {
      reject(error)
    }
  })
}
